<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      /* height: 0.5px; */
      background-color: red;
      height: 1px;
      transform: scaleY(0.5);
      transform-origin: 50% 100%; /*为了防止线模糊*/
    }
  </style>
</head>
<body>
  <div></div>

  <svg xmlns='http://www.w3.org/2000/svg' width='100%' height='1px'>
    <line x1='0' y1='0' x2='100%' y2='0' stroke='#000'></line>
</svg>
</body>
</html>